/*
@author: Edgar Pereira
Nº 6207
*/

typedef int (*compfn)(const void*, const void*);

//#############################################################################
// Structures used
//#############################################################################
struct nTeachersYear{
	int year;
	int number;
};

struct nEstabYear{
	int year;
	int number;
};

struct nDegreeYear{
	int year;
	int number;
};

struct nTeachersEstabYear{

	char* estab;
	int number;
};

struct nTeachersDegreeYear{

	char* degree;
	int number;
};

struct nTeachersDegreeEstYear{

	char* degree;
	char* estab;
	int number;
};

struct lEstabYear{

	char* name;
};

struct lHolDeg{

	char* name;
	char* degree;
};
//#############################################################################

int strucCompare(struct nTeachersYear *a, struct nTeachersYear *b);

int strucnTeachersEstabYearCompare(struct nTeachersEstabYear *a, struct nTeachersEstabYear *b);

int strucnTeachersDegreeYearCompare(struct nTeachersDegreeYear *a, struct nTeachersDegreeYear *b);

int strucnHolDegYear(struct lHolDeg *a, struct lHolDeg *b);

int strucnTeachersDegreEestYearCompare(struct nTeachersDegreeEstYear *a, struct nTeachersDegreeEstYear *b);

int strucnLHolDeg(struct lHolDeg *a, struct lHolDeg *b);

int strucnEstabYear(struct lEstabYear *a, struct lEstabYear *b);

int int_cmp(const void *a, const void *b);

int callback(void **contagem, int argc, char **argv, char **azColName);

int callbackTuple(struct nTeachersEstabYear **nTeachersEstabYear, int argc, char **argv, char **azColName);

int callbackHolDeg(struct lHolDeg ** lHolDeg, int argc, char **argv, char **azColName);

int callbacknTeachersDegreeEstYear(struct nTeachersDegreeEstYear **nTeachersDegreeEstYear, int argc, char **argv, char **azColName);

int callbackEstList(struct lEstabYear **lEstabYear, int argc, char **argv, char **azColName);

void mYqSort(void* base[], int nel, int width, compfn *function);

PyObject* nEstabYear();

PyObject* nDegreeYear();

int* nEstabDeg();

PyObject* nTeachYear();

int* nTeachDeg();

struct nTeachersEstabYear* nTeachEstYear(int year, int nEstab);